package ace.module.captcha.core.impl.dao.repository;

import ace.cmp.spring.data.jdbc.querydsl.core.repository.QuerydslJdbcBaseRepository;
import ace.module.captcha.core.impl.constant.CaptchaCoreConstant;
import ace.module.captcha.core.impl.dao.entity.CaptchaApplication;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.springframework.stereotype.Repository;

/**
 * 图形验证码应用 repository.
 *
 * @author Caspar
 */
@DS(CaptchaCoreConstant.DEFAULT_DATA_SOURCE_NAME)
@Repository
public interface CaptchaApplicationRepository
    extends QuerydslJdbcBaseRepository<CaptchaApplication, Long> {

  Boolean existsByKey(String key);

  CaptchaApplication getByKey(String key);

  CaptchaApplication getByKeyAndDeleteFlag(String key, Long deleteFlag);

}
